import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router'
import BasicLayout from '../layouts/BasicLayout.vue'
import BlankLayout from '../layouts/BlankLayout.vue'

export const allRoutes = [
  {
    path: '/login',
    name: 'login',
    meta: { title: '登录', icon: 'HomeOutlined', hidden: false },
    component: () => import('@/views/user/Login.vue'),
  },
  {
    path: '/register',
    name: 'register',
    meta: { title: '注册', icon: 'HomeOutlined', hidden: false },
    component: () => import('@/views/user/Register.vue'),
  },
  {
    path: '/forgotpwd',
    name: 'forgotpwd',
    meta: { title: '重置密码', icon: 'HomeOutlined', hidden: false },
    component: () => import('@/views/user/ForgotPwd.vue'),
  },
  {
    path: '/no-content',
    name: 'noContent',
    meta: { title: '', icon: 'LaptopOutlined', flat: false, hidden: false },
    component: () => import('@/views/no-content/Index.vue'),
  },
  {
    path: '/',
    name: 'index',
    meta: { title: '首页', icon: 'HomeOutlined', hidden: false },
    component: BasicLayout,
    redirect: '/work-place',
    children: [
      {
        path: '/work-place',
        name: 'workPlace',
        meta: { title: '工作台', icon: 'LaptopOutlined', flat: false, hidden: false },
        component: () => import('@/views/work-place/index.vue'),
      },
      {
        path: '/promotion-center',
        name: 'promotionCenter',
        meta: { title: '推广中心', icon: 'DingtalkOutlined', flat: false, hidden: false },
        component: () => import('@/views/promotion-center/List.vue'),
      },
      {
        path: '/data-center',
        name: 'dataCenter',
        meta: { title: '数据中心', icon: 'RadarChartOutlined', flat: false, hidden: false },
        component: () => import('@/views/data-center/List.vue'),
      },
      {
        path: '/account',
        name: 'account',
        meta: {
          title: '平台账号',
          icon: 'UserOutlined',
          flat: false,
          hidden: false,
          // videoKey: 'https://yun-resource.nianchu.net/video/demo/%E8%BF%94%E5%88%A9.mp4',
        },
        component: () => import('@/views/account/List.vue'),
      },
      {
        path: '/fans',
        name: 'fans',
        meta: { title: '粉丝管理', icon: 'TeamOutlined', flat: false, hidden: false },
        redirect: '/my-fans',
        children: [
          {
            path: '/my-fans',
            name: 'myFans',
            meta: { title: '我的粉丝', icon: 'TeamOutlined', flat: false, hidden: false },
            component: () => import('@/views/fans/my-fans/List.vue'),
          },
          {
            path: '/fan-group-post',
            name: 'fanGroupPost',
            meta: { title: '粉丝群发', icon: 'WifiOutlined', flat: false, hidden: false },
            component: () => import('@/views/fans/fan-group-post/List.vue'),
          },
        ],
      },
      {
        path: '/order',
        name: 'order',
        meta: { title: '订单管理', icon: 'OrderedListOutlined', flat: false, hidden: false },
        component: () => import('@/views/order/List.vue'),
      },
      {
        path: '/financial-center',
        name: 'financialCenter',
        meta: { title: '财务日志', icon: 'PayCircleOutlined', flat: false, hidden: false },
        component: () => import('@/views/financial-center/List.vue'),
      },
      {
        path: '/system-setting',
        name: 'systemSetting',
        meta: { title: '系统设置', icon: 'SettingOutlined', flat: false, hidden: true },
        component: () => import('@/views/system-setting/List.vue'),
      },
      {
        path: '/im-customer-service',
        name: 'IMCustomerService',
        meta: { title: '集成客服', icon: 'RedditOutlined', flat: false, hidden: false },
        component: () => import('@/views/im-customer-service/List.vue'),
      },
      {
        path: '/intelligent-qa',
        name: 'intelligentQA',
        meta: { title: '智能问答', icon: 'RobotOutlined', flat: false, hidden: false },
        component: () => import('@/views/intelligent-qa/List.vue'),
      },
      {
        path: '/question-answer',
        name: 'questionAnswer',
        meta: { title: '回复文案', icon: 'MessageOutlined', flat: false, hidden: false },
        component: () => import('@/views/question-answer/List.vue'),
      },
      // {
      //   path: '/quotation-rules',
      //   name: 'quotationRules',
      //   meta: { title: '渠道询价模式', icon: 'ToolOutlined', flat: false, hidden: false },
      //   // component: () => import('@/views/quotation-rules/List.vue'),
      //   component: () => import('@/views/pre-quotation/List.vue'),
      // },
      // {
      //   path: '/pre-quotation',
      //   name: 'preQuotation',
      //   meta: { title: '专业报价模式', icon: 'ToolOutlined', flat: false, hidden: false },
      //   component: () => import('@/views/quotation-rules/List.vue'),
      //   // component: () => import('@/views/pre-quotation/List.vue'),
      // },

      {
        path: '/ocr-record',
        name: 'ocrRecord',
        meta: { title: '识别记录', icon: 'OrderedListOutlined', flat: false, hidden: false },
        component: () => import('@/views/ocr-record/List.vue'),
      },

      {
        path: '/rules',
        name: 'rules',
        meta: { title: '报价规则', icon: 'ToolOutlined', flat: false, hidden: false },
        redirect: '/quotation-rules',
        children: [
          {
            path: '/quotation-rules',
            name: 'quotationRules',
            meta: { title: '渠道询价模式', icon: 'ToolOutlined', flat: false, hidden: false },
            // component: () => import('@/views/quotation-rules/List.vue'),
            component: () => import('@/views/pre-quotation/List.vue'),
          },
          {
            path: '/pre-quotation',
            name: 'preQuotation',
            meta: { title: '专业报价模式', icon: 'ToolOutlined', flat: false, hidden: false },
            component: () => import('@/views/quotation-rules/List.vue'),
            // component: () => import('@/views/pre-quotation/List.vue'),
          },
        ],
      },
      {
        path: '/offer-record',
        name: 'offerRecord',
        meta: { title: '报价记录', icon: 'OrderedListOutlined', flat: false, hidden: false },
        component: () => import('@/views/offer-record/List.vue'),
      },
      {
        path: '/xy-platform',
        name: 'xyPlatform',
        meta: { title: '闲鱼平台功能', icon: 'AppstoreOutlined', flat: false, hidden: false },
        redirect: '/xy-index',
        children: [
          {
            path: '/xy-index',
            name: 'xyIndex',
            meta: { title: '宝贝管理', icon: 'GiftOutlined', flat: false, hidden: false },
            component: () => import('@/views/xy-platform/xy-index/Index.vue'),
          },
          {
            path: '/transaction-manage',
            name: 'transactionManage',
            meta: { title: '交易管理', icon: 'OrderedListOutlined', flat: false, hidden: false },
            component: () => import('@/views/xy-platform/TransactionManage/Index.vue'),
          },
          {
            path: '/evaluate-manage',
            name: 'EvaluateManage',
            meta: { title: '评价管理', icon: 'HighlightOutlined', flat: false, hidden: false },
            component: () => import('@/views/xy-platform/evaluate-manage/Index.vue'),
          },
          // {
          //   path: '/product-manage',
          //   name: 'productManage',
          //   meta: { title: '宝贝管理', icon: 'GiftOutlined', flat: false, hidden: false },
          //   component: () => import('@/views/xy-platform/product-manage/List.vue'),
          // },
          // {
          //   path: '/time-product-manage',
          //   name: 'timeProductManage',
          //   meta: { title: '定时发品', icon: 'GiftOutlined', flat: false, hidden: false },
          //   component: () => import('@/views/xy-platform/time-product-manage/List.vue'),
          // },
          // {
          //   path: '/order-manage',
          //   name: 'orderManage',
          //   meta: { title: '订单管理', icon: 'OrderedListOutlined', flat: false, hidden: false },
          //   component: () => import('@/views/xy-platform/order-manage/List.vue'),
          // },
          // {
          //   path: '/automatic-upscaling',
          //   name: 'automaticUpscaling',
          //   meta: { title: '自动发布（影票代订业务）', icon: 'UploadOutlined', flat: false, hidden: false },
          //   component: () => import('@/views/xy-platform/automatic-upscaling/List.vue'),
          // },
          // {
          //   path: '/automatic-polishing',
          //   name: 'automaticPolishing',
          //   meta: { title: '自动擦亮', icon: 'SyncOutlined', flat: false, hidden: false },
          //   component: () => import('@/views/xy-platform/automatic-polishing/List.vue'),
          // },
          {
            path: '/product-optimization',
            name: 'productOptimization',
            meta: { title: '商品优化', icon: 'AlertOutlined', flat: false, hidden: false },
            component: () => import('@/views/xy-platform/product-optimization/List.vue'),
          },
          {
            path: '/product-backlist',
            name: 'productBacklist',
            meta: { title: '公共黑名单', icon: 'UsergroupDeleteOutlined', flat: false, hidden: false },
            component: () => import('@/views/xy-platform/product-black/index.vue'),
          },
          // {
          //   path: '/xy-refund-order',
          //   name: 'xyRefundOrder',
          //   meta: { title: '退款订单', icon: 'OrderedListOutlined', flat: false, hidden: false },
          //   component: () => import('@/views/xy-platform/refund-order/List.vue'),
          // },
          {
            path: '/xy-industry-category',
            name: 'xyIndustryCategory',
            meta: { title: '行业控制', icon: 'SortAscendingOutlined', flat: false, hidden: false },
            component: () => import('@/views/xy-platform/industry-category/List.vue'),
          },
        ],
      },
      {
        path: '/add-new-pro',
        name: 'AddNewPro',
        meta: { title: '发布商品', icon: 'GiftOutlined', flat: false, hidden: true },
        component: () => import('@/views/xy-platform/product-manage/components/AddNewPro.vue'),
      },
      {
        path: '/edit-new-pro',
        name: 'EditNewPro',
        meta: { title: '编辑商品', icon: 'GiftOutlined', flat: false, hidden: true },
        component: () => import('@/views/xy-platform/product-manage/components/EditNewPro.vue'),
      },
      {
        path: '/wx',
        name: 'wx',
        meta: { title: '微信平台功能', icon: 'AppstoreOutlined', flat: false, hidden: false },
        redirect: '/wx-platform',
        children: [
          {
            path: '/wx-platform',
            name: 'wxPlatform',
            meta: { title: '自动朋友圈', icon: 'WechatOutlined', flat: false, hidden: false },
            component: () => import('@/views/wx-platform/auto-moments/List.vue'),
          },
        ],
      },
      {
        path: '/card-resource',
        name: 'cardResource',
        meta: { title: '卡券资源', icon: 'CreditCardOutlined', flat: false, hidden: false },
        redirect: '/zi-you',
        children: [
          {
            path: '/zi-you',
            name: 'ziYou',
            meta: { title: '自有卡券', icon: 'CreditCardOutlined', flat: false, hidden: false },
            component: () => import('@/views/card-resource/zi-you/List.vue'),
          },
          {
            path: '/san-fang',
            name: 'sanFang',
            meta: { title: '三方卡券', icon: 'CreditCardOutlined', flat: false, hidden: false },
            component: () => import('@/views/card-resource/san-fang/List.vue'),
          },
          {
            path: '/guan-fang',
            name: 'guanFang',
            meta: { title: '官方卡券', icon: 'CreditCardOutlined', flat: false, hidden: false },
            component: () => import('@/views/card-resource/guan-fang/List.vue'),
          },
        ],
      },
      {
        path: '/nine-one-category-list',
        name: 'nineOneCategoryList',
        meta: { title: '卡种列表', icon: 'CreditCardOutlined', flat: false, hidden: false },
        component: () => import('@/views/card-resource/zi-you/nine-one/CategoryList.vue'),
      },
      {
        path: '/xing-chi-category-list',
        name: 'xingChiCategoryList',
        meta: { title: '卡种列表', icon: 'CreditCardOutlined', flat: false, hidden: false },
        component: () => import('@/views/card-resource/zi-you/xing-chi/CategoryList.vue'),
      },
      // {
      //   path: '/card-coupons',
      //   name: 'cardCoupons',
      //   meta: { title: '91卡券', icon: 'CreditCardOutlined', flat: false, hidden: false },
      //   redirect: '/authorization-list',
      //   children: [
      //     {
      //       path: '/authorization-list',
      //       name: 'authorizationList',
      //       meta: { title: '授权列表', icon: 'CreditCardOutlined', flat: false, hidden: false },
      //       component: () => import('@/views/card-coupons/List.vue'),
      //     },
      //     {
      //       path: '/category-list',
      //       name: 'categoryList',
      //       meta: { title: '卡种列表', icon: 'CreditCardOutlined', flat: false, hidden: false },
      //       component: () => import('@/views/card-coupons/CategoryList.vue'),
      //     },
      //   ],
      // },
      // {
      //   path: '/card-coupons-xc',
      //   name: 'cardCouponsXC',
      //   meta: { title: '星驰卡券', icon: 'CreditCardOutlined', flat: false, hidden: false },
      //   redirect: '/authorization-list-xc',
      //   children: [
      //     {
      //       path: '/authorization-list-xc',
      //       name: 'authorizationListXC',
      //       meta: { title: '用户列表', icon: 'CreditCardOutlined', flat: false, hidden: false },
      //       component: () => import('@/views/card-coupons-xc/List.vue'),
      //     },
      //     {
      //       path: '/category-list-xc',
      //       name: 'categoryListXC',
      //       meta: { title: '卡种列表', icon: 'CreditCardOutlined', flat: false, hidden: false },
      //       component: () => import('@/views/card-coupons-xc/CategoryList.vue'),
      //     },
      //   ],
      // },
      {
        path: '/user-pedigree',
        name: 'userPedigree',
        meta: { title: '用户族谱', icon: 'TransactionOutlined', flat: false, hidden: false },
        component: () => import('@/views/user-pedigree/index.vue'),
      },

      {
        path: '/user-black',
        name: 'userBlack',
        meta: { title: '黑名单审核', icon: 'TransactionOutlined', flat: false, hidden: false },
        component: () => import('@/views/user-black/index.vue'),
      },
      // ----------------------------------------------------------------------------------------
      {
        path: '/account-system',
        name: 'accountSystem',
        meta: { title: '账号设置', icon: 'SettingOutlined', flat: false, hidden: true },
        component: () => import('@/views/account-system/List.vue'),
      },
      {
        path: '/fund-detail',
        name: 'fundDetail',
        meta: { title: '资金明细', icon: 'TransactionOutlined', flat: false, hidden: true },
        component: () => import('@/views/fund-detail/List.vue'),
      },
      {
        path: '/assets-manage',
        name: 'assetsManage',
        meta: { title: '资产管理', icon: 'TransactionOutlined', flat: false, hidden: false },
        component: () => import('@/views/assets-manage/List.vue'),
      },
      {
        path: '/user-list',
        name: 'userList',
        meta: { title: '用户列表', icon: 'TransactionOutlined', flat: false, hidden: true },
        component: () => import('@/views/user-list/List.vue'),
      },
      {
        path: '/order-manage-list',
        name: 'orderManage-list',
        meta: { title: '用户订单', icon: 'TransactionOutlined', flat: false, hidden: true },
        component: () => import('@/views/order-manage-list/List.vue'),
      },
      {
        path: '/admin-financial-detail',
        name: 'adminFinancialDetail',
        meta: { title: '用户资金明细', icon: 'TransactionOutlined', flat: false, hidden: true },
        component: () => import('@/views/admin-financial-detail/List.vue'),
      },
      {
        path: '/admin-account',
        name: 'adminAccount',
        meta: { title: '用户账号列表', icon: 'TransactionOutlined', flat: false, hidden: true },
        component: () => import('@/views/admin-account/List.vue'),
      },
      {
        path: '/integral-product',
        name: 'integralProduct',
        meta: { title: '积分商品', icon: 'TransactionOutlined', flat: false, hidden: true },
        component: () => import('@/views/integral-product/List.vue'),
      },

      // {
      //   path: '/pre-quotation',
      //   name: 'preQuotation',
      //   meta: { title: '（专业）自定义规则设置', icon: 'ToolOutlined', flat: false, hidden: true },
      //   // component: () => import('@/views/pre-quotation/List.vue'),
      //   component: () => import('@/views/quotation-rules/List.vue'),
      // },
    ],
  },
]

export default createRouter({
  history: createWebHashHistory(),
  routes: allRoutes,
})
